import { defineStore } from "pinia";

export const useAppStore = defineStore("app", {
  state: () => {
    return {
      dsId: localStorage.getItem("_dsId") || "",
      // baseApi: "http://61.52.247.249:20111",
      // baseApi: "/t_api",
      // baseApi: "http://61.52.247.249:13020",
      baseApi: "https://lj.zzfmhb.com:12081/api",
      // baseApi: "http://61.52.247.249:20111",
      fileBaseUrl: "",
      // baseApi: "http://172.16.2.60:39010",
    };
  },
  actions: {
    syncDsId(dsId) {
      this.dsId = dsId;
      if (dsId) {
        localStorage.setItem("_dsId", dsId);
      } else {
        localStorage.removeItem("_dsId");
      }
    },
  },
});
